#include "ReadFile.h"

namespace Core
{
	rtReadFile::rtReadFile(std::string& fileName):
    rtFile(fileName)
	{

	}


	rtReadFile::~rtReadFile(void)
	{
	}

	int rtReadFile::read(void* buf, int len)
	{
		return 0;
	}

	

	int rtReadFile::readInt(int& value)
	{
		return readData(value);
	}

	int rtReadFile::readUnsignedInt(unsigned int& value)
	{
		return readData(value);
	}

	int rtReadFile::readShort(short& value)
	{
		return readData(value);
	}

	int rtReadFile::readUnsignedShort(unsigned short& value)
	{
		return readData(value);
	}

	int rtReadFile::readChar(char& value)
	{
		return readData(value);
	}

	int rtReadFile::readUnsignedChar(unsigned char& value)
	{
		return readData(value);
	}

	int rtReadFile::readByte(unsigned char& value)
	{
		return readData(value);
	}

	int rtReadFile::readFloat(float& value)
	{
		return readData(value);
	}

	int rtReadFile::readBool(bool& value)
	{
		unsigned char charValue;
		int result = readUnsignedChar(charValue);
		value = (charValue != 0 ? true : false);
		return result;
	}

	int rtReadFile::readString(std::string& value)
	{
		int len;
		int result;
		result = readInt(len);
		char* strBuf = new char [len + 1];
		readArrayData(strBuf, len);
		strBuf[len] = 0;
		value = strBuf;
		delete [] strBuf;
		return result;
	}

	int rtReadFile::readVector2(rtVector2& value)
	{
		return read(&value[0], sizeof(rtVector2));
	}

	int rtReadFile::readVector3(rtVector3& value)
	{
		return read(&value[0], sizeof(rtVector3));
	}

	int rtReadFile::readVector4(rtVector4& value)
	{
		return read(&value[0], sizeof(rtVector4));
	}

	int rtReadFile::readMatrix3(rtMatrix3& value)
	{
		return read(&value[0], sizeof(rtMatrix3));
	}

	int rtReadFile::readMatrix4(rtMatrix4& value)
	{
		return read(&value[0], sizeof(rtMatrix4));
	}
}

